package interview.javabase.thread.futuretask;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author 大硕
 * 2019-03-28 9:59 PM
 **/
public class FutureTaskDemo {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> task = new FutureTask<>(new WxzCallable());
        new Thread(task).start();

        if (!task.isDone()) {
            System.out.println("not com.study.normal.done");
        }

        System.out.println("task return " + task.get());
    }
}